<f:view
		xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core"
		xmlns:a4j="http://richfaces.org/a4j"
		xmlns:rich="http://richfaces.org/rich"
		xmlns:ui="http://java.sun.com/jsf/facelets"
		xmlns:itdep="http://itdep.bsuir.by/jsf"
		>
	<ui:decorate template="/facelets/template/mainTemplate.xhtml">
		<ui:define name="title">#{securityBundle.users}</ui:define>
		<ui:define name="center">
			<ui:decorate template="/facelets/template/centerTemplate.xhtml">
				<ui:define name="content">
					<h:messages/>
					<ui:decorate template="/facelets/template/tableTemplate.xhtml">
						<ui:param name="actionBean" value="#{userBean}"/>
						<ui:param name="idPrefix" value="user"/>
						<ui:define name="editPanelContext">
							<h:panelGrid columns="3">
								<rich:pickList value="#{userBean.roles}"
											   converter="#{userBean.converter}"
											   rendered="#{userBean.resultListFilled}"
											   copyAllControlLabel="add all"
											   removeAllControlLabel="remove all"
											   copyControlLabel="add"
											   removeControlLabel="remove"
											   switchByClick="true">
									<itdep:entitySelectItems entityType="role" format="{name}"/>
									<a4j:support event="onlistchanged" reRender="result"/>
								</rich:pickList>
								<rich:panel id="result" bodyClass="pbody">
									<f:facet name="header">
										<h:outputText>
											#{userBean.items} Options Choosen
										</h:outputText>
									</f:facet>
									<rich:dataList value="#{userBean.roles}" var="pickList" rendered="#{userBean.items>0}">
										<h:outputText value="#{pickList.name}"/>
									</rich:dataList>
								</rich:panel>

								<h:outputText value="#{securityBundle.employeeName}"/>
								<itdep:entitySelectMenu value="#{userBean.record.employee}" entityType="employee" format="{lastName} {firstName}" required="false"/>
								<rich:spacer/>

							</h:panelGrid>
						</ui:define>

						<ui:define name="tableContext">
							<rich:column width="1%">
								<f:facet name="header"><h:outputText value="#{dictionaryBundle.id}"/></f:facet>
								<h:outputText value="#{record.id}"/>
							</rich:column>
							<rich:column width="7%">
								<f:facet name="header"><h:outputText value="#{personBundle.user}"/></f:facet>
								<itdep:entityOutput value="#{record.employee}" format="{lastName} {firstName}" locale="#{translationBean.locale}"/>
							</rich:column>
							<rich:column width="28%">
								<f:facet name="header"><h:outputText value="#{securityBundle.login}"/></f:facet>
								<h:outputText value="#{record.login}"/>
							</rich:column>
							<rich:column width="28%">
								<f:facet name="header"><h:outputText value="#{securityBundle.roleName}"/></f:facet>
								<itdep:entityOutput value="#{record.roles}" format="{authority} ({name})" locale="#{translationBean.locale}"/>
							</rich:column>
						</ui:define>

					</ui:decorate>
				</ui:define>
			</ui:decorate>
		</ui:define>
	</ui:decorate>


</f:view>